package ru.susu.algebra.ranks;

import java.math.BigInteger;

/**
 * @author akargapolov
 * @since 03.12.2011
 */
public class GraphicsCreator
{
	private static int LAST_NUMBER = 1000;
	private static int INTERVAL = 10;

	public static void main(String[] args) throws Exception
	{
//		printAllNumbers();
//		printAllPartitions();
//		printAllRanks();
		printAllAsymptoticRanks();
	}
	
	public static void printAllNumbers()
	{
		for (int i = INTERVAL;i<=LAST_NUMBER;i+=INTERVAL)
		{
			System.out.println(i + ",");
		}
	}
	
	public static void printAllPartitions()
	{
		int size = LAST_NUMBER + 1;
		BigInteger[] array = new BigInteger[size];
		for (int i = 0; i < size; i++)
		{
			array[i] = BigInteger.valueOf(0);
		}
		array[0] = BigInteger.valueOf(1);

		for (int i = 1; i < size; i++)
		{
			for (int j = 0; j + i < size; j++)
			{
				array[j + i] = array[j + i].add(array[j]);
			}
		}

		for (int i = INTERVAL; i < size; i+=INTERVAL)
		{
			System.out.println(array[i] + ",");
		}
	}
	
	public static void printAllRanks()
	{
		for (int i = INTERVAL;i<=LAST_NUMBER;i+=INTERVAL)
		{
			System.out.println(FromSquareFileRanksProvider.ranks.get(i) + ",");
		}
	}
	
	public static void printAllAsymptoticRanks()
	{
		for (int i = INTERVAL;i<=LAST_NUMBER;i+=INTERVAL)
		{
			System.out.println(String.format("%.0f", PartitionsCounter.getAsymptoticRank(i)) + ",");
		}
	}
}
